import request from '@/utils/request'

// 查询代理关系列表
export function listRelations(query) {
  return request({
    url: '/consumer/relations/list',
    method: 'get',
    params: query
  })
}

// 查询代理关系详细
export function getRelations(agentId) {
  return request({
    url: '/consumer/relations/' + agentId,
    method: 'get'
  })
}

// 新增代理关系
export function addRelations(data) {
  return request({
    url: '/consumer/relations',
    method: 'post',
    data: data
  })
}

// 修改代理关系
export function updateRelations(data) {
  return request({
    url: '/consumer/relations',
    method: 'put',
    data: data
  })
}

// 删除代理关系
export function delRelations(agentId) {
  return request({
    url: '/consumer/relations/' + agentId,
    method: 'delete'
  })
}
